package com.lzk.过滤器和拦截器.myInterceptorProject.config;

import com.lzk.过滤器和拦截器.myInterceptorProject.MyInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author: zhongkui 1365693530@qq.com
 * @Date: 2024/11/12
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        MyInterceptor myInterceptor = new MyInterceptor();
        registry.addInterceptor(myInterceptor)
                //拦截的范围
                .addPathPatterns("/*");


    }
}
